/**
 * Alibaba.com.cn Inc.
 * Copyright (c) 2004-2021 All Rights Reserved.
 */
package com.smart.common.scheduler;

import com.smart.common.scheduler.service.TempTaskScheduleSmsService;
import com.smart.common.scheduler.service.WeeklyTaskScheduleSmsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 项目周报，临时任务短信提示定时任务
 * @author zhanghong
 * @version WeeklyTaskAndTempTaskScheduler.java, v 0.1 2023/9/25 15:30 下午 WeeklyTaskAndTempTaskScheduler Exp $$
 */
@Slf4j
@Component
public class WeeklyTaskAndTempTaskSmsScheduler {

    @Autowired
    private WeeklyTaskScheduleSmsService weeklyTaskScheduleSmsService;
    @Autowired
    private TempTaskScheduleSmsService tempTaskScheduleSmsService;

    ///**
    // * 周报任务
    // * 周一上午10点
    // */
    //@Scheduled(cron ="0 0 10 ? * MON")
    //public void weeklyTaskSunday() {
    //    weeklyTaskScheduleSmsService.weeklyTaskSunday();
    //}

    /**
     * 周报任务
     * 周四下午14点
     */
    @Scheduled(cron ="0 0 14 ? * THU")
    public void weeklyTaskThursday() {
        weeklyTaskScheduleSmsService.weeklyTaskThursday();
    }

    /**
     * 临时任务
     * 每天上午10点
     */
    @Scheduled(cron ="0 0 10 ? * *")
    public void tempTaskStart() {
        tempTaskScheduleSmsService.tempTaskStart();
    }

    /**
     * 临时任务
     * 每天下午14点
     */
    @Scheduled(cron ="0 0 14 ? * *")
    public void tempTaskEnd() {
        tempTaskScheduleSmsService.tempTaskEnd();
    }
}
